<%@ page language="java" contentType="text/html; charset=utf-8"	pageEncoding="utf-8"%>
<%
	String typeId = (String) request.getAttribute("typeId");
%>
<html>
<head>


<script type="text/javascript">
	var typeId=<%=typeId%>;
	var listUrl = "dict/index.do?typeId="+typeId;

	$(document).ready(function() {

	});
	//end ready

	function save() {
		//$('#fm').birthday 编辑日期表单值，然后提交
		$('#fm').form('submit', {
			url : 'rest/dictAdd.do',
			onSubmit : function() {
				var validator = $(this).form('validate');
				if (validator) {
					$.messager.progress();
				}
				return validator;
			},
			success : function(result) {
				$.messager.progress('close');
				var result = eval('(' + result + ')');
				if (result.retCode == '0000') {
					back(listUrl);

				} else {
					$.messager.show({
						title : 'Error',
						msg : result.retMsg
					});
				}
			}
		});
	}

	function back(url) {
		$.get(url, {}, function(data) {
			$("#center").empty();
			$("#center").html(data);
			$.parser.parse($("#center"));
		});
	}
</script>
</head>
<body>
<div class="linkbar"><a>系统</a>/<a>字典类型管理</a>/<a>字典管理</a>/<a>新增字典</a></div>
	<!-- <div class="breadcrumb">系统 &gt;&gt; 字典管理 &gt;&gt; 新增字典</div> -->
	<div id="div-add" >
		<form id="fm" method="post" novalidate>
			<INPUT TYPE=hidden NAME=typeId VALUE="<%=typeId%>">
			<div class="fitem">
				<label>字典名称:</label> <input name="dictName"
					class="easyui-validatebox" missingMessage="该输入项不能为空！"
					required="true" />
			</div>

			<div class="fitem">
				<label>字典值:</label> <input name="dictValue" class="easyui-validatebox"
					missingMessage="该输入项不能为空！" required="true" />
			</div>
			<div class="fitem">
				<label>备注：</label> <input name="dictDesc"
					class="easyui-validatebox" required="true">
			</div>

			
		</form>
	</div>
	<div id="dlg-buttons">
		<a href="#" class="easyui-linkbutton" iconCls="icon-ok"
			onclick="save()">保存</a> <a href="#" class="easyui-linkbutton"
			iconCls="icon-cancel" onclick="back(listUrl)">返回</a>
	</div>


</body>
</html>